package com.test.demo.annotation.proxy.http.handler;

import org.springframework.beans.factory.annotation.Autowired;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @ClassName MyInvocationHandler
 * @Description
 * @Author laigl
 * @Date 2020/2/22 22:46
 **/
public class MyInvocationHandler implements InvocationHandler {

    @Autowired
    private MyFeginClientSupport myFeginClientSupport;

    public MyInvocationHandler(MyFeginClientSupport myFeginClientSupport) {
        this.myFeginClientSupport = myFeginClientSupport;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) {
        Object o = myFeginClientSupport.invoke(proxy, method, args);
        String s = (String) o;
        return o;
    }
}
